<?php $formulaire->display('_formulaireList.tpl'); ?>
<br />
<a class="icon_check" href="<?php echo shRequest::link('administration', 'saisiesalle', 'print', array($date,$promos), 'pdf') ?>">Imprimer la liste des séances sans salle</a>

<form class="without" method="post" action="<?php echo shRequest::link('administration', 'saisiesalle', 'edit', array($date, $promos)) ?>">
<?php foreach ( $promotions AS $promotion ):
	if ( empty($promotion->seances) ) continue; ?>
	<h2><?php echo $promotion->titre ?></h2>
	<table class="liste">
		<thead>
			<tr>
				<th>UE</th>
				<th style="width:110px;">Date</th>
				<th style="width:120px;">Horaires</th>
				<th style="width:200px;">Salle</th>
			</tr>
		</thead>
		<tbody>
			<?php foreach($promotion->seances AS $seance):  ?>
				<tr>
					<td><?php echo $seance->type_enseignement . ' ' . apostrophe('de', $seance->ue) ?></td>
					<td><?php echo Date::fromSGBD($seance->jour)->format('j F Y') ?></td>
					<td><?php echo DateTime::createFromFormat('H:i:s',$seance->heure_debut)->format('H\hi') . ' - ' . DateTime::createFromFormat('H:i:s',$seance->heure_fin)->format('H\hi') ?></td>
					<td style="text-align:center;"><select name="salle[<?php echo $seance->id ?>]"><option value="0" selected="selected"></option><?php foreach($salles AS $salle): ?><option value="<?php echo $salle->id; ?>"><?php echo $salle->intitule; ?></option><?php endforeach; ?></select></td>
				</tr>
			<?php endforeach; ?>
		</tbody>
	</table>
<?php endforeach; ?>
<div style="text-align:right"><input type="submit" name="submit_" class="submit" value="Valider les salles" /></div>
</form>